import service from "../../utils/request"

export const addBanner = async(data: Banner): Promise<Result<string>> =>
await service.post(`/banner`, data)

export const getBannerPage = async(page: number, banner_name: string): Promise<PageResult<ListBanner[]>> =>
await service.get(`/banner/page?page=${page}&banner_name=${banner_name}`)

export const editBanner = async (id: string, data: Banner): Promise<Result<string>> =>
await service.patch(`/banner/${id}`, data)

export const delBanner = async (id: string): Promise<Result<string>> =>
await service.delete(`/banner/${id}`)

export const manyDelBanner = async (ids: string): Promise<Result<string>> =>
    await service.delete(`/banner/many/${ids}`)
